﻿
using OddUserManager.Model;
using System;
using System.Collections.Generic;
using System.Text;

namespace OddUserManager.Data.IRepositories
{
    public interface IAppUserRepository: IRepository<AppUser>
    {
        bool InsertOrUpdateUser(AppUser user);

        bool UpdateLogonTime(int id, DateTime lastLogonTime, int logonTimes);

        /// <summary>
        /// 检查用户是存在
        /// </summary>
        /// <param name="userName">用户名</param>
        /// <param name="password">密码</param>
        /// <returns>存在返回用户实体，否则返回NULL</returns>
        AppUser CheckUser(string userName, string password);
        /// <summary>
        /// 根据ID获取用户和他的角色
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        AppUser GetWithRoles(int id);
       
    }
}
